import React from 'react';

function StateHooks() {

    const [count, setCount] = React.useState(0)

    function functionAdd() {
        // setCount(count + 2)
        setCount(count => count + 1)
    }

    return (
        <div>
            <h1> get sum : {count}</h1>
            <button onClick={functionAdd}> clickAddTwo</button>
        </div>
    );
}

export default StateHooks;